﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ColorGame
{
    public partial class Form1 : Form
    {
        Graphics graphics;
        public Form1()
        {
            InitializeComponent();
            graphics = Graphics.FromHwnd(this.Handle);
        }
        float x = 10;
        float y = 10;
        private void timer1_Tick(object sender, EventArgs e)
        {
            float x1 =0;
            float y1=0;

            x1 = x + 1;



            y1 = Convert.ToSingle( 100.0*Math.Sin(x/40)+400);




            graphics.DrawLine(new Pen(Brushes.Red, 5), new PointF(x, y), new PointF(x1, y1));
            x = x1;
            y = y1;

        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
    }
}
